<template>
	<view class="store-container">
		<!-- 门店搜索 -->
		<view class="store-search">
			<view class="location l-btn btn-primary" bindtap="handleChooseLocation" v-if="diningMode!=='wx_out'">
				<view class='location-wrap' @click.stop="onChooseLocation">
					<view class="iconfont icon-weizhitubiao"></view>
					<view selectable="true" class="location-txt overflow-ellipsis">{{currentPos}}</view>
				</view>
				<image src=""
				 class="select-icon" />
			</view>
			<view class="location l-btn btn-primary" v-else>
				<view class="delivery-txt overflow-ellipsis">{{deliveryAddress.building}}</view>
			</view>
			<view class="search flex-center">
				<view class="iconfont icon-sousuotubiao"></view>
				<input type="text" class="search-input" confirm-type="search" placeholder="搜索门店" placeholder-class="search-placeholder"
				 @confirm="onConfirmSearch" />
			</view>
		</view>
		<!-- 门店列表 -->
		<scroll-view class="store-list-area" scroll-y scroll-with-animation>
			
			<view class="no-auth" v-if="!isAuthLocation && !storeList.length">
				<view>获取位置失败，不能为您推荐附近的门店</view>
				<view>请手动选择位置或输入门店名称</view>
			</view>
			
			<store-list :storeList="storeList" @onTapStore="onTapStore"></store-list>
		</scroll-view>
	</view>
</template>

<script>
	import data from './store.js';
	export default data;
</script>

<style lang="less" scoped>
	@import '~@/common/styles/common.less';
	@import './store.less';
</style>
